What does it mean, the following error message:
Type mismatch: cannot convert from Class<capture#1-of ?> to Class<?>[]
The code is following:
Class<?>[] encoderClass;Class<?>[] encoderClasses =newClass<?>[]{Encoder1.class,Encoder2.class,Encoder3.class};for(int i=0; i<encoderClasses.length;++i){ encoderClass = encoderClasses[i];// <------ error is here}
Anonymous User
05-Nov-2014You're attempting to assign a single class element to a class array (different types as per the error message). Instead, assign each individual element in the for loop
ensuring that the array is initialized to avoid NPE in the assignment
For simplicity you could replace the entire loop with